﻿using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;

namespace ELKLogger.WebApi.Controllers
{
    /// <summary>
    /// ELK日志模块测试
    /// </summary>
    [ApiController]
    [Route("LogTest")]
    public class LogTestController : AbpController
    {
        /// <summary>
        /// 依赖注入ILogger
        /// </summary>
        public ILogger<LogTestController> logger { get; set; }

        /// <summary>
        /// 测试日志写入
        /// </summary>
        /// <returns></returns>
        [HttpGet("LogInfo")]
        public string TestLogInformation()
        {
            logger.LogInformation("LogInformation 测试日志写入...");
            return "LogInformation";
        }

        /// <summary>
        /// 测试日志写入
        /// </summary>
        /// <returns></returns>
        [HttpGet("LogError")]
        public string TestLogError()
        {
            logger.LogError("LogError 测试日志写入...");
            return "LogError";
        }

        /// <summary>
        /// 测试日志写入
        /// </summary>
        /// <returns></returns>
        [HttpGet("LogWarning")]
        public string TestLogWarning()
        {
            logger.LogWarning("LogError 测试日志写入...");
            return "Success";
        }

        /// <summary>
        /// 测试日志写入
        /// </summary>
        /// <returns></returns>
        [HttpGet("LogDebug")]
        public string TestLogDebug()
        {
            logger.LogDebug("LogDebug 测试日志写入...");
            return "LogDebug";
        }

    }
}
